package com.ruoyi.common.exception;

/**
 * GlobalCheckException
 *
 * @author HHKJ-SERVER-ZJ
 * @since 2023/10/31 15:17
 */
public class GlobalCheckException extends RuntimeException {

    private static final long serialVersionUID = 1L;

    /** 错误提示 */
    private String message;

    /** 错误明细，内部调试错误 */
    private String detailMessage;

    /** 根据code前端做出 */
    private int code;

    /** 空构造方法，避免反序列化问题 */
    public GlobalCheckException() {
    }

    public GlobalCheckException(int code, String message) {
        this.message = message;
        this.code = code;
    }

    public int getCode() {
        return this.code;
    }

    public String getDetailMessage() {
        return detailMessage;
    }

    public GlobalCheckException setDetailMessage(String detailMessage) {
        this.detailMessage = detailMessage;
        return this;
    }

    @Override
    public String getMessage() {
        return message;
    }

    public GlobalCheckException setMessage(String message) {
        this.message = message;
        return this;
    }
}
